<!--{include file='admin/public/header.html'}-->
<script type="text/javascript">
$(function(){
	$("#form1").validationEngine();
});
</script>
     <div class="content">
        <div class="page-header">
          <h3 class="fl">增加分类</h3>
          <div class="user_message fr"><i class="icon-wrench"></i>增加您的分类菜单</div>
          <div class="cl"></div>
        </div>
        <form name="form1" id="form1" class="form-inline" action="" method="post">
        <table class="table set_table">
          <thead>
            <tr>
              <th width="11%" >功 能</th>
              <th >配 置</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>栏目类型</td>
              <td>
              <select class="span3 cateType" name="type"  >
                <!--{foreach from=$type key=k item=v}-->
                <option value="<!--{$v.mod}-->"  <!--{if $v.mod == $data.type}-->selected="selected"<!--{/if}-->><!--{$v.name}--></option>
                <!--{/foreach}-->
              </select>
              </td>
            </tr>
            <tr>
              <td>所属栏目</td>
              <td>
              <select class="span3 parentCate" name="parentid"  >
                <option value="0" >一级分类</option>
             <!--{foreach from=$data.category key=k item=v}-->
                <option value="<!--{$v.id}-->"  type="<!--{$v.type}-->"  <!--{if $v.id == $data.parentid}-->selected="selected"<!--{/if}-->><!--{$v.categoryname}--></option>
            <!--{/foreach}-->
              </select>
              
              </td>
            </tr>
            <tr>
              <td>栏目名称</td>
              <td>
              <input class="span4 validate[required]" name="categoryname" id="cl_name" type="text" x-webkit-speech value='<!--{$data.categoryname}-->' />
            </tr>
            
          </tbody>
        </table>
         <p class="border_top"> <button class="btn btn-primary btn-small input-small" type="submit">修改</button> </p>
        </form>
       
  </div>
<script type="text/javascript">
$(function(){
	$('.parentCate').change(function(){
		var parentType = $('.parentCate').find("option:selected").attr('type');
		if(parentType != null){
			$(".cateType").attr("value", parentType);
		}
	});
})
</script>
<!--{include file='admin/public/footer.html'}-->